package cn.wostore.wxhelper.bean;

import android.content.ContentValues;
import android.database.Cursor;

public class ForwardRule {
    /*规则id*/
    private Integer forwardRuleId;

    /*规则名称*/
    private String forwardRuleTitle;

    /*规则开启状态*/
    private boolean forwardRuleState;

    /*只在时间段里开启*/
    private boolean forwardRuleIntervalState;

    /*直播主讲群id*/
    private String forwardMainGroupId;

    /*直播主讲群名字*/
    private String forwardMainGroupName;

    /*直播主讲人id*/
    private String forwardMasterId;

    /*直播主讲人名字*/
    private String forwardMasterName;

    /*直播子群id集合*/
    private String forwardChildGroupIds;

    /*直播子群名字集合*/
    private String forwardChildGroupNames;

    /*转发消息类型文字（false）*/
    private boolean forwardMsgText;

    /*转发消息类型语音（false）*/
    private boolean forwardMsgVoice;

    public Integer getForwardRuleId() {
        return forwardRuleId;
    }

    public void setForwardRuleId(Integer forwardRuleId) {
        this.forwardRuleId = forwardRuleId;
    }

    public String getForwardRuleTitle() {
        return forwardRuleTitle;
    }

    public void setForwardRuleTitle(String forwardRuleTitle) {
        this.forwardRuleTitle = forwardRuleTitle;
    }

    public boolean isForwardRuleState() {
        return forwardRuleState;
    }

    public void setForwardRuleState(boolean forwardRuleState) {
        this.forwardRuleState = forwardRuleState;
    }

    public boolean isForwardRuleIntervalState() {
        return forwardRuleIntervalState;
    }

    public void setForwardRuleIntervalState(boolean forwardRuleIntervalState) {
        this.forwardRuleIntervalState = forwardRuleIntervalState;
    }

    public String getForwardMainGroupId() {
        return forwardMainGroupId;
    }

    public void setForwardMainGroupId(String forwardMainGroupId) {
        this.forwardMainGroupId = forwardMainGroupId;
    }

    public String getForwardMainGroupName() {
        return forwardMainGroupName;
    }

    public void setForwardMainGroupName(String forwardMainGroupName) {
        this.forwardMainGroupName = forwardMainGroupName;
    }

    public String getForwardMasterId() {
        return forwardMasterId;
    }

    public void setForwardMasterId(String forwardMasterId) {
        this.forwardMasterId = forwardMasterId;
    }

    public String getForwardMasterName() {
        return forwardMasterName;
    }

    public void setForwardMasterName(String forwardMasterName) {
        this.forwardMasterName = forwardMasterName;
    }

    public String getForwardChildGroupIds() {
        return forwardChildGroupIds;
    }

    public void setForwardChildGroupIds(String forwardChildGroupIds) {
        this.forwardChildGroupIds = forwardChildGroupIds;
    }

    public String getForwardChildGroupNames() {
        return forwardChildGroupNames;
    }

    public void setForwardChildGroupNames(String forwardChildGroupNames) {
        this.forwardChildGroupNames = forwardChildGroupNames;
    }

    public boolean isForwardMsgText() {
        return forwardMsgText;
    }

    public void setForwardMsgText(boolean forwardMsgText) {
        this.forwardMsgText = forwardMsgText;
    }

    public boolean isForwardMsgVoice() {
        return forwardMsgVoice;
    }

    public void setForwardMsgVoice(boolean forwardMsgVoice) {
        this.forwardMsgVoice = forwardMsgVoice;
    }

    public ContentValues getForwardRuleContentValues() {
        ContentValues contentValues = new ContentValues();
        contentValues.put("forwardRuleId", this.forwardRuleId);
        contentValues.put("forwardRuleTitle", this.forwardRuleTitle);
        contentValues.put("forwardRuleState", this.forwardRuleState);
        contentValues.put("forwardRuleIntervalState", this.forwardRuleIntervalState);
        contentValues.put("forwardMainGroupId", this.forwardMainGroupId);
        contentValues.put("forwardMainGroupName", this.forwardMainGroupName);
        contentValues.put("forwardMasterId", this.forwardMasterId);
        contentValues.put("forwardMasterName", this.forwardMasterName);
        contentValues.put("forwardChildGroupIds", this.forwardChildGroupIds);
        contentValues.put("forwardChildGroupNames", this.forwardChildGroupNames);
        contentValues.put("forwardMsgText", this.forwardMsgText);
        contentValues.put("forwardMsgVoice", this.forwardMsgVoice);

        return contentValues;
    }

    public void setValues(Cursor cursor) {
        this.setForwardRuleId(cursor.getInt(cursor.getColumnIndex("forwardRuleId")));
        this.setForwardRuleTitle(cursor.getString(cursor.getColumnIndex("forwardRuleTitle")));
        this.setForwardRuleState(cursor.getInt(cursor.getColumnIndex("forwardRuleState")) == 1);
        this.setForwardRuleIntervalState(cursor.getInt(cursor.getColumnIndex("forwardRuleIntervalState")) == 1);
        this.setForwardMainGroupId(cursor.getString(cursor.getColumnIndex("forwardMainGroupId")));
        this.setForwardMainGroupName(cursor.getString(cursor.getColumnIndex("forwardMainGroupName")));
        this.setForwardMasterId(cursor.getString(cursor.getColumnIndex("forwardMasterId")));
        this.setForwardMasterName(cursor.getString(cursor.getColumnIndex("forwardMasterName")));
        this.setForwardChildGroupIds(cursor.getString(cursor.getColumnIndex("forwardChildGroupIds")));
        this.setForwardChildGroupNames(cursor.getString(cursor.getColumnIndex("forwardChildGroupNames")));
        this.setForwardMsgText(cursor.getInt(cursor.getColumnIndex("forwardMsgText")) == 1);
        this.setForwardMsgVoice(cursor.getInt(cursor.getColumnIndex("forwardMsgVoice")) == 1);
    }
}
